After more headbanging and research I seemed to notice that DAC(blah,blah); doesn't like anything but integers.
I came up with this.....and I'm prepared to hear that it's nonsense...lol.
#include "KMotionDef.h"
main()
{
float speed = *(float *)&persist.UserData[0]; // value stored is actually a float
printf("Spindle Set to %f\n",speed); // print the desired speed
int dacout = speed/1.4655;
DAC(2,dacout);
}
My DAC to rpm ratio is 1.4655.
I was able too find info on the persist,UserData[0].....so that question is answered.
Will this work if I set my var as 0 for the s program execute?
Mike
--- In
DynoMotion@yahoogroups.com, "michaelthomasn" <michaelniksch@...> wrote:
>
> Tom,
>
> I am trying to set up the spindle on this grinder. It is a dac output servo like the other axis', but there is no encoder.
>
> It just turns on and runs at a specified rpm....there is no positioning.
>
> I can get the spindle to turn with a move command in the console....but I want to have it turn on and off with the m commands and run to a particular rpm with the s command.
>
> I have the axis configured as no input, dac output. I suspect that I should command movement with dac output.....but that does not work on the console screen.
>
> Do I need to select user input?
>
> I'm not sure what to do.
>
> Mike
>